package cn.jboa.dao.impl;

import cn.jboa.dao.CliamVouCherDetailDao;
import cn.jboa.entity.BizClaimVoucher;
import cn.jboa.entity.BizClaimVoucherDetail;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

@Repository("cliamVouCherDetailDao")
public class CliamVouCherDetailDaoImpl extends BaseHibernateDaoSupport<BizClaimVoucherDetail> implements CliamVouCherDetailDao {
    @Autowired
    public CliamVouCherDetailDaoImpl(@Qualifier("sessionFactory")SessionFactory sessionFactory){
        this.setSessionFactory(sessionFactory);
    }

    public int deleteByCliamVouCher(BizClaimVoucher claimVoucher) {
        String hql="delete from  BizClaimVoucherDetail where claimVoucher.id=? ";
        return this.getHibernateTemplate().bulkUpdate(hql,claimVoucher.getId());
    }
}
